package com.zluyuer.ermu;

import java.util.Map.Entry;

import com.zluyuer.ermu.msg.MessageHandler;


public class DemoMessageHandler implements MessageHandler<DemoMessage> {

    @Override
    public void execute(DemoMessage msg) throws Exception {
        System.out.println("id: " + msg.getId());
        System.out.println("code: " + msg.getCode());
        System.out.println("str: " + msg.getStr());
        System.out.println("num: " + msg.getNum());
        System.out.println("strlist");
        for (String str : msg.getStrlist()) {
            System.out.println("\t" + str);
        }
        System.out.println("numlist");
        for (Integer num : msg.getNumlist()) {
            System.out.println("\t" + num);
        }
        System.out.println("map");
        for (Entry<String, Integer> entry : msg.getMap().entrySet()) {
            System.out.println("\t" + entry.getKey() + ":" + entry.getValue());
        }
    }

}
